package cn.jimmie.learn.viewArt

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View

class MainActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    fun refreshClick(v: View) {
        startIntent(ShowActivity.REFRESH_VIEW)
    }

    fun heartClick(v: View) {
        startIntent(ShowActivity.HEART_VIEW)
    }

    fun autoLineClick(v: View) {
        startIntent(ShowActivity.AUTO_LINE_VIEW)
    }

    fun lrcClick(v: View) {
        startIntent(ShowActivity.LRC_VIEW)
    }

    fun overlayerClick(v: View) {
        startIntent(ShowActivity.OVERLAYER_VIEW)
    }

    fun ballClick(v: View) {
        startIntent(ShowActivity.BALL_VIEW)
    }

    fun captchaClick(v: View) {
        startIntent(ShowActivity.CAPTCHA_VIEW)
    }

    fun loadClick(v: View) {
        startIntent(ShowActivity.LOAD_VIEW)
    }

    fun roundImageClick(v: View) {
        startIntent(ShowActivity.ROUND_IMAGE)
    }

    fun xfermodeClick(v: View) {
        startIntent(ShowActivity.XFERMODE_VIEW)
    }

    fun gameClick(v: View) {
        startIntent(ShowActivity.GAME_VIEW)
    }

    fun butterflyClick(v: View) {
        startIntent(ShowActivity.BUTTERFLY_VIEW)
    }

    fun layoutClick(v: View) {
        startIntent(ShowActivity.LAYOUT_VIEW)
    }

    private fun startIntent(tag: Int) {
        val intent = Intent(this, ShowActivity::class.java)
        intent.putExtra("tag", tag)
        startActivity(intent)
    }
}